package com.whales.shared.util;

import org.jdom.Document;
import org.jdom.Element;

public class XmlUtil {
	
	public static Document buildDocForServerCommand(String message) throws Exception{
		Document protocol = new Document();
		Element root = new Element("sever-command");
		Element command = new Element("command");
		command.setText(message);
		root.addContent(command);
		protocol.setRootElement(root);
		return protocol;
	}
	
	public static Document buidDocForServerResponse(String message) throws Exception{
		Document protocol = new Document();
		Element root = new Element("sever-response");
		Element command = new Element("result");
		command.setText(message);
		root.addContent(command);
		protocol.setRootElement(root);
		return protocol;
	}
}
